﻿@inject IDataCacheService _dataCacheService


@if (string.IsNullOrWhiteSpace(Url))
{
    <span class="@(Class+" d-flex ma-1")" style=" align-items: center;">
        <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="@Icon" IconString="@IconString" />
        @if (string.IsNullOrWhiteSpace(Title) == false)
        {
            <span style="word-break: keep-all;">
                @Title：
            </span>
        }
        <span itemprop="@ItemProp">
            @Text
        </span>
    </span>
}
else
{

    <span class="@(Class+" d-flex ma-1")" style=" word-break: break-all; align-items: center;">
        <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="@Icon" IconString="@IconString" />
        <span style="word-break: keep-all;"> @Text</span>
        <a href="@Url" target="_blank" itemprop="@ItemProp">@Url</a>
    </span>
}


@code {
    [Parameter]
    public string Title { get; set; }
    [Parameter]
    public string Text { get; set; }
    [Parameter]
    public string Class { get; set; }
    [Parameter]
    public string Url { get; set; }
    [Parameter]
    public IconType Icon { get; set; }
    [Parameter]
    public string IconString { get; set; }
    [Parameter]
    public string ItemProp { get; set; }
    [Parameter]
    public string Content { get; set; }
}
